package com.dd.common.entity;

import com.dd.common.IErrorCode;

public enum ResultCode implements IErrorCode {
    SUCCESS(2000, "操作成功"),
    FAILED(5000, "操作失败"),

    UNAUTHORIZED(4001, "暂未登录或token已经过期"),
    FORBIDDEN(4003, "没有相关权限"),
    ADMIN_LOGIN_PASS(5002, "用户名密码错误"),
    AUTHENTICATION_FAIL(5001, "认证失败"),
    SYSTEM_EXCEPTION(5999, "系统繁忙"),

    /** 请求参数异常 ***/
    VALIDATE_FAILED(6000, "请求参数错误"),
    VALIDATE_FAILED_ISNULL(6001, "请求参数为空"),
    ;

    private int code;
    private String message;

    private ResultCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }
}
